<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>模拟v-html及v-on指令</title>
</head>
<body>
    <div id="testDIV" v-on:click="clickSingle">
        {{text1}} {{text2}}
    </div>
    <div id="testDIV2">{{text3}}</div>
    <div v-html="htmlTemplate"></div>
<script type="module">
    import VueImitator from './VueImitator.js';
    let vImitator = new VueImitator({
        data() {
            return {
                text1: '左手一只鸡',
                text2: '走到一起来，走成一片爱',
                text3: '我们走到一起来，走成一种风景千姿百态，走成一个故事丰富精彩',
                htmlTemplate: '<p style=\'color:red\'>走成一种风景千姿百态</p>'
            }
        },
        methods: {
            clickSingle(_this) {
                let target = _this || this;
                target.text1 = '我的事件';
                target.text2 = '一定能找到解决的方法的';
            }
        }
    });

    //vImitator.text1 = '英勇果断';
    //vImitator.text2 = '精彩绝伦';
    console.log(vImitator);
</script>
</body>
</html>